{extend name="ashippingguide/Public/base" /}
{block name="container"}
<div class="page-heade">
    <h2 class="title_color text-center">导购人员薪资级别管理</h2>
</div>
<form action="" class="form-inline" id="form1" method="post">
    <table class="table table-bordered bud_hei">
        <tr>
            <td>模糊查询：</td>
            <td>姓名：</td>
            <td><input type="text" class="form-control" name="a_name" value="<?php if(isset($where['a_name'])) echo $where['a_name']; ?>"></td>
            <td>薪资级别：</td>
            <td><input type="text" class="form-control" name="b_salaryLevel" value="<?php if(isset($where['b_salaryLevel'])) echo $where['b_salaryLevel']; ?>"></td>
            <td>网点名称：</td>
            <td><input type="text" class="form-control" name="a_mainNet" value="<?php if(isset($where['a_mainNet'])) echo $where['a_mainNet']; ?>"></td>
            <td>
                <button class="btn-sm btn-info btn" type="submit">查询</button><span class="lr_5"></span><button class="btn-sm btn-info btn" type="submit" id="reset">清空查询条件</button><span class="lr_5"></span><a href="javascript:;" class="btn btn-sm btn-info">薪资级别分析</a>
            </td>
        </tr>
    </table>
<table class="table table-striped table-bordered table-hover bud_hei text-center">
    <tr class="info">
        <th class="text-center">No.</th>
        <th class="text-center">姓名</th>
        <th class="text-center" style="width: 50%">标准网点名称</th>
        <th class="text-center">岗位类型</th>
        <th class="text-center">薪资级别</th>
        <th class="text-center">维护</th>
    </tr>
    <tbody style="border: 0">
    {volist name="data" id="list"}
    <tr>
        <td>{$i}</td>
        <td><a href="{:url('Other/guidendetailzl')}">{$list.name}</a></td>
        <td class="text-left">{$list.mainNet}</td>
        <td>{$list.postType}</td>
        <td><a onclick="info({$list.id})" class="seedetail">{$list.salaryLevel}</a></td>
        <td><a href="javascript:;" onclick="edit({$list.id})" class="modify">修改</a></td>
    </tr>
    {/volist}
    </tbody>
</table>
<h5 class="text-center"  style="font-size: 13px;font-weight: 500">
    总共有{$count}条记录，第{$page}/{$maxpage}页,当前页<input id="page" name="pages" type="text" style="width: 40px" value="1"/>
    <button id="gopage">Go</button>&nbsp;&nbsp;<button
        id="fistpage" onclick="$('#form1').find('input').val('');">首页</button>&nbsp;&nbsp;
    每页显示
    <select id="pagesize" name="limts">
        <option value='10' selected>10条</option>
        <option value='15'>15条</option>
        <option value='20'>20条</option>
    </select>
    <script>
        $('#pagesize').val("{$limit}");
    </script>
</h5>
</form>
<div class="ibox-content" style="display: none;" id="xinzijb">
        <table class="table table-bordered text-center">
            <tr>
                <td style="width: 140px">薪资级别名称</td>
                <td class="text-left" id="xz1"></td>
            </tr>
            <tr>
                <td>基本工资(元/月)</td>
                <td class="text-left" id="gj1"></td>
            </tr>
            <tr>
                <td>所属城市类别</td>
                <td class="text-left" id="lx1"></td>
            </tr>
        </table>
</div>
<div class="ibox-content" style="display: none;" id="modifyDiv">
    <form action="{:url('ashippingguide/editLevel')}" class="form-inline" id="form2" method="post">
        <table class="table table-bordered text-center">
            <input type="hidden" name="id" value="" id="id1">
            <tr>
                <td>职员姓名</td>
                <td class="text-left" id="xm1"></td>
            </tr>
            <tr>
                <td>薪资级别<span class="colorRed">*</span></td>
                <td class="text-left">
                    <select name="salarylevel_id" id="jb1" class="form-control select">
                        <option value="">请选择</option>
                        {volist name="zxjb" id="xz"}
                        <option value="{$xz.id}">{$xz.salaryLevel}</option>
                        {/volist}
                    </select>
                </td>
            </tr>
        </table>
    </form>

</div>
<script>
    //详情
    function info(id){
        $.get("{:url('ashippingguide/infoP')}",{id:id},function(e){
            $('#xz1').text(e.salaryLevel);
            $('#gj1').text(e.basePay);
            $('#lx1').text(e.cityType);
            layer.open({
                type: 1,
                title: '薪资级别详情',
                area: ['800px', '500px'],
                fixed: false, //不固定
                maxmin: true,
                content: $('#xinzijb')
                /*   yes: function (i, o) {
                       var param = $('#form1').serialize()
                   $.post('/index/workflowdb/ysfy_cg.html', param, function (data) {
                       if (data.success) {
                           swal({title: data.msg}, function () {
                               layer.close(i)
                               location.reload()
                           })
                       } else {
                           swal(data.msg)
                       }
                   }, 'json')
               }
    */
            });
        },'json');

    }
    //编辑
    function edit(id){
        $.get("{:url('ashippingguide/infoP')}",{id:id},function(e){
            $('#id1').val(e.aid);
            $('#xm1').text(e.name);
            $('#jb1').val(e.id);
            layer.open({
                type: 1,
                title: '导购职员薪资级别更改',
                area: ['800px', '500px'],
                fixed: false, //不固定
                maxmin: true,
                btn:['提交','返回'],
                content: $('#modifyDiv'),
                yes: function (i,o){
                    $('#form2').submit();
            }
                /*   yes: function (i, o) {
                  var param = $('#form1').serialize()
              $.post('/index/workflowdb/ysfy_cg.html', param, function (data) {
                  if (data.success) {
                      swal({title: data.msg}, function () {
                          layer.close(i)
                          location.reload()
                      })
                  } else {
                      swal(data.msg)
                  }
              }, 'json')
          }
    */

            });
        },'json');

    }

//     $(".seedetail").click(function(){
//     })


    $(document).ready(function () {
    })
    $('#reset').on('click',function () {
        $("#form1 input").each(function(){
            $(this).val('');
        });
        $("#form1 select").each(function(){
            $(this).val('');
        });
        $('#form1').submit()
        return false
    })
    /*修改*/
    // $(document).on("click",".modify",function(){
    // })

</script>
{/block}